#[derive(Debug)]
struct Rectangle {
    width: u32,
    height: u32,
}

impl Rectangle {
    fn area(&self) -> u32 {
        self.width * self.height
    }
}

impl Rectangle {
    // getter
    fn width(&self) -> u32 {
        self.width
    }
}

fn main() {
    let rect1 = Rectangle {
        width: 30,
        height: 50,
    };
    let area = rect1.area();
    println!("{},{}", area, rect1.width());

    println!("{:#?}", rect1) // Rectangle 外部属性 #[derive(Debug)]
}
